<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
  //函数的声明
  // foo()
  // function foo() {
  // console.log("foo被执行了")
  // }   
  // foo()
  // //函数表达式
  console.log(message)  //undefined
  var message="why"
  console.log(bar)
  bar()
  
  var name="why"
  var bar=function(){//把函数赋值给变量
console.log("bar函数被执行~")
  }
  

 
  
  </script>
</body>
</html>